
Good PSP Programing Site
~~~~~~~~~~~~~~~~~~~~~~~~
http://www.psp-programming.com/
http://www.psp-programming.com/forums/
http://forums.qj.net/f-psp-development-forum-11.html/





-- Randomly open a file with any name in a folder?
-- Code Start --

openfileRandom = function(name, ext, numOfFile) --Name must be with no extension
        math.randomseed(os.time());
        local number = math.random(1, numOfFile);
        
        local path = (name .. number .. ext); 

        local tempFile = io.open(path, "r+");

        return tempFile;
end 

myFile = openfileRandom("Map", ".tmp", 26);

-- Code End --


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-- Loading Sound --
-- Code Start --

boltsnd = Sound.load("music/startup.wav")

while true do

boltsnd:play()
screen.waitVblankStart(200)
Music.volume(128)

pad = Controls.read() 

if pad:start() then
       break
    end
  end

-- Code End --

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

